﻿    <script type="text/javascript">
        $(document).ready(function () {
            var p = new singlepage();
            p.c = "Way.Bus.WMS.Controllers.MoveOrderController";
            p.applyTo = "t1";
            p.ishelp = false;
            p.onCommandClick = function (command, form, item) {
                if (command == "edit") {
                    form.setdisabled(true);
                    for (var i in form.griditems) {
                        var grid = form.griditems[i];
                        grid.setdisabled(true);
                    }
                }
            }
            p.init();
        });

        function import4(data) {
            try {
                $('<div id="d2"><div id="d3"/></div>').appendTo($("#temp"));
                var p1 = new datasource();
                p1.c = "Way.Bus.WMS.ST.Controllers.ST_MoveExcelDRController";
                p1.applyTo = "d3";
                if (data && data.item) {
                    var issubmit = data.item.ISSUBMITED;
                    if (issubmit) {
                        $.messager.alert('提示', '移位单已提交，不能进行导入操作！', 'info');
                        return null;
                    }
                } else {
                    $.messager.alert('提示', '请选择一个移位单！', 'info');
                    return null;
                }
                //限制主单导入显示
                data.sender.datasource.modeldata.nimport = true;
                window.ddata = data;
                window.pdata = p1;
                p1.init();
                $('#d2').dialog({
                    title: "导入数据",
                    collapsible: false,
                    resizable: false,
                    width: 700,
                    height: 400,
                    cache: false,
                    href: "Views/manager/Exceldr.htm",
                    onClose: function () {
                        $(this).panel('destroy');
                        $("#temp").empty();
                        window.ddata = null;
                    }
                });
            } catch (e) {

            }
        }
      </script>
<div id="t1"></div>
